//acwing


//https://www.acwing.com/problem/content/3771/


//双指针


#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const int N=2e5+10;
#define INF 0x3f3f3f3f;
typedef long long int ll;
#define close(); std::ios::sync_with_stdio(false);cin.tie(0),cout.tie(0);
//----------------------------------------------------------------------------//
int n,st[26];
int main()
{
	close();
	cin>>n;
	string s;
	cin>>s;
	memset(st,0,sizeof st);

	int ans=0;
	for(int i=0;i<n;i++)
	{
		int j=i;
		if(s[i]=='x')
		{
			int cnt=0;
			while(s[j]=='x'&&j<n) cnt++,j++;
			if(cnt>=3) ans+=cnt-2;
		}
		i=j;
	}
	cout<<ans<<'\n';

	return 0;
}